import { defineStore } from "pinia";
import { getcategoryList } from "@/api/products/classify";

const useClassifyStore = defineStore("classify", {
  state: () => ({
    list: []
  }),
  actions: {
    // 获取用户信息
    async getList(params) {
      console.log("获取自定义分类tree");
      let List = [];
      await getcategoryList(params).then(res => {
        console.log("分类列表===", res);
        if (res.code === 200) {
          this.list = res.data;
          List = res.data;
        }
      });
      return List;
    }
  }
});

export default useClassifyStore;
